export default {
  methods: {
    edit(row) {
      this.axios.get(`${this.apis.userDetail}/${row.userid}`).then(res => {
        this.showEaDialog = true;
        this.eaDialog.$data.type = "edit";
        const { schoolCode } = res;
        res.schoolCode = schoolCode ? schoolCode : this.getUserSchoolCode();
        this.eaDialog.getDepAndClass(res.schoolCode);
        this.$nextTick(() => {
          this.eaDialog.$data.singleData = res;
        });
      });
    },
    setUserStatus(status, { userid }) {
      this.axios
        .put(`${this.apis.setUserStatus}/${userid}/${status}`)
        .then(res => {
          this.$notify.success("更改用户状态成功！");
        });
    },
    reset(row) {
      this.axios.put(`${this.apis.resetPwd}/${row.userid}`).then(res => {
        this.$notify.success("重置密码成功！新密码为1");
      });
    }
  }
};
